﻿using System;
namespace Common
{
	public static class TAssert
	{
		public static void IsNotNull<T>(T t, string message = null)
		{
			bool isnull = false;

			while (true)
			{
				if (!(typeof(T) is object))
					break;

				var obj = t as object;
				if (obj != null)
					break;

				isnull = true;

				break;
			}

			TAssert.Assert(!isnull, message);
		}

		public static void Assert(bool assert, string message = null)
		{
			if (!assert)
				throw new Exception(message ?? "Is Null Assert Exception");
		}
	}
}
